var EventEmitter = require("events").EventEmitter;
var ee = new EventEmitter();

var listener1 = function(foo,bar){
	console.log("第一个监听器");
}
var listener2 = function(foo,bar){
	console.log("第二个监听器");
}

var listener = function(foo,bar){
	console.log("其它监听器");
}

ee.on("some_events",listener1);
ee.on("some_events",listener2);

ee.on("other_events",listener);

/**
 * EventEmitter.removeAllListener(["events"])  删除某一事件所有的监听器
 * 参数 ：events 字符串，事件名  可选参数,如果空值，则删除所有监听器
 */
 
 ee.emit("some_events","wilson","zhong");
 ee.emit("other_events","wilson","zhong");
 
 ee.removeAllListeners("some_events");
 console.log("删除some_event")
 ee.emit("some_events","wilson","zhong");
 ee.emit("other_events","wioson","zhong");
 
 ee.removeAllListeners();
 console.log("全部删除")
 ee.emit("some_events","wilson","zhong");
 ee.emit("other_events","wioson","zhong");
 